package com.zhs.smartmall.product.dto;

import com.zhs.smartmallcommon.valid.AddGroup;
import com.zhs.smartmallcommon.valid.ListValue;
import com.zhs.smartmallcommon.valid.UpdateGroup;
import com.zhs.smartmallcommon.valid.UpdateStatusGroup;
import io.swagger.annotations.ApiModel;
import lombok.*;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;

import javax.validation.constraints.*;

/**
 *
 * @author zhenghuisheng
 * @since 2023-11-11
 */
@Data
@ApiModel(value = "PmsBrandDto")
public class PmsBrandDto implements Serializable {
        //表字段
        private static final long serialVersionUID = 1L;



        @NotNull(message = "修改必须指定品牌id",groups = {UpdateGroup.class})
        @Null(message = "新增不能指定id",groups = {AddGroup.class})
        @JsonSerialize(using = ToStringSerializer.class)
        @ApiModelProperty(value = "主键")
        private Long id;

        @NotNull(message = "修改必须指定品牌id",groups = {UpdateGroup.class})
        @Null(message = "新增不能指定id",groups = {AddGroup.class})
        @ApiModelProperty(value = "品牌名")
        private String name;

        @NotNull(groups = {AddGroup.class, UpdateStatusGroup.class})
        @ListValue(vals={0,1},groups = {AddGroup.class, UpdateStatusGroup.class})
        @ApiModelProperty(value = "品牌logo地址")
        private String logo;

        @NotBlank(message = "品牌名必须提交",groups = {AddGroup.class,UpdateGroup.class})
        @ApiModelProperty(value = "介绍")
        private Object descript;

        @NotNull(groups = {AddGroup.class, UpdateStatusGroup.class})
        @ListValue(vals={0,1},groups = {AddGroup.class, UpdateStatusGroup.class})
        @ApiModelProperty(value = "显示状态[0-不显示；1-显示]")
        private Integer showStatus;

        @NotEmpty(groups={AddGroup.class})
        @Pattern(regexp="^[a-zA-Z]$",message = "检索首字母必须是一个字母",groups={AddGroup.class,UpdateGroup.class})
        @ApiModelProperty(value = "检索首字母")
        private String firstLetter;

        @NotNull(groups={AddGroup.class})
        @Min(value = 0,message = "排序必须大于等于0",groups={AddGroup.class,UpdateGroup.class})
        @ApiModelProperty(value = "排序")
        private Integer sort;

        @ApiModelProperty(value = "创建时间")
        @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date createTime;

        @ApiModelProperty(value = "更新时间")
        @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date updateTime ;

        @ApiModelProperty(value = "是否删除")
        private Integer isDeleted;

        //=====================自定义字段=====================

        //id
        private List<String> idList;
}
